package nextee.cabletest.db;

import com.j256.ormlite.field.DatabaseField;
import nextee.cabletest.protocol.ProtocolData;

import java.util.Date;

/**
 * Created by George.Yuan on 2015/4/29.
 */
public class CableData {
    @DatabaseField(generatedId = true)
    public int id;

    @DatabaseField
    public int channel;

    @DatabaseField
    public int position;

    @DatabaseField
    public int voltage;

    @DatabaseField
    public int current;

    @DatabaseField
    public Date time;

    public void setCableData(ProtocolData proto_data){
        channel = proto_data.channel;
        position = proto_data.position;
        voltage = proto_data.voltage;
        current = proto_data.current;
        time = new Date();
    }
}
